/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rational.parser.operation;

import org.rational.parser.expression.Expression;
import org.rational.parser.type.Type;

/**
 *
 * @author Overmind
 */
public abstract class UnaryPostfixOperation<R, F>
    extends Operation
{
    public UnaryPostfixOperation(int priority, String symbol, 
            Type<R> resultType, Type<F> argumentType)
    {
        super(priority, new Expression(Expression.DEFAULT_ARGUMENT_SYMBOL + symbol), 
                resultType, new Type[] {argumentType});
    }

    @Override
    protected final Object calculateOfObjects(Object[] arguments)
    {
        return calculate((F)arguments[0]);
    }
    
    public abstract R calculate(F first);
}